pub(crate) fn main() {
    f1();
    // f2();
    // f3();
    // f4();
    // f5();
    // f6();
}

fn f1(){
    let x = 5;
    println!("The value of x is: {}", x);
    // x = 6;
    println!("The value of x is: {}", x);
}

fn f2(){
    let mut x = 5;
    println!("The value of x is: {}", x);
    x = 6;
    println!("The value of x is: {}", x);
}

fn f3(){
    let _x = 5;
    let y = 10;
}

fn f4(){
    let (a, mut b): (bool,bool) = (true, false);
    // a = true,不可变; b = false，可变
    println!("a = {:?}, b = {:?}", a, b);

    b = true;
    assert_eq!(a, b);
}

fn f5(){
    let x = 5;
    // 在main函数的作用域内对之前的x进行遮蔽
    let x = x + 1;

    {
        // 在当前的花括号作用域内，对之前的x进行遮蔽
        let x = x * 2;
        println!("The value of x in the inner scope is: {}", x);
    }

    println!("The value of x is: {}", x);
}

fn f6(){
    for i in 'a'..='z' {
        println!("{}",i);
    }
}
